<template>
  <header-block class="header" />
  <!-- <RouterView v-slot="{ Component }">
    <KeepAlive>
      <component :is="Component" :key="$route.name" v-if="$route.meta.keep"></component>
    </KeepAlive>
    <component :is="Component" :key="$route.name" v-if="!$route.meta.keep"></component>
  </RouterView> -->
  <RouterView/>
</template>

<script setup>
import { onMounted, toRefs } from "vue"
import { RouterLink, RouterView } from 'vue-router'
import HeaderBlock from "@/components/header/HeaderBlock.vue"

//引入store钩子
import useCounterStore from '@/stores/counter.js'
//实现仓库数据双向绑定
import {storeToRefs} from 'pinia'

//创建仓库对象
const store=useCounterStore()
let {toast}=storeToRefs(store)

</script>

<style scoped>
  .header {
    position: sticky;
    top: 0px;
    left: 0px;
    right: 0px;
    z-index: 999;
  }
</style>
